<%@page import="java.util.HashMap"%>
<%@page import="java.util.Map"%>
<%@page import="java.util.Date"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<c:set var="name" value="aaa" scope="request"></c:set>
	<p>${name}</p>
	<p><c:out value="${name}"></c:out></p>
	
	<c:if test="${name eq 'aaa'}">名字正确</c:if>
	<br>
	
	<c:set var="sel" value="5" scope="request"></c:set>
	<c:choose>
		<c:when test="${sel eq '1'}">AAA</c:when>
		<c:when test="${sel eq '2'}">BBB</c:when>
		<c:when test="${sel eq '3'}">CCC</c:when>
		<c:otherwise>什么都不是</c:otherwise>
	</c:choose>
	
	<%
		List<Integer> list = new ArrayList<Integer>();
		list.add(1);
		list.add(2);
		list.add(3);
		list.add(4);
		list.add(5);
		list.add(6);
		request.setAttribute("list", list);
		
		Map<String,String> map = new HashMap<String,String>(); 
		map.put("a", "12345"); 
		map.put("b", "abcde"); 
		request.setAttribute("map",map); 
	%>
	<br>
	<p>循环list</p>
	<c:forEach var="i" items="${list}" begin="0" end="5" step="1">
		<input type="text" value="${i}"><br>
	</c:forEach>
	<br>
	<p>循环map</p>
	<c:forEach var="map" items="${map}">
		<h3>${map.key}--${map.value}</h3>
	</c:forEach>
	
	
	<c:set var="str" value="a,b,c,d,e"></c:set>
	<c:forTokens var="s" items="${str}" delims=",">
		<input type="text" value="${s}"><br>
	</c:forTokens>
	
	
	<br><br>
	<%
		Date date = new Date();
		request.setAttribute("date", date);
	%>
	<fmt:formatDate value="${date}" pattern="yyyy-MM-dd HH:mm:ss"></fmt:formatDate>
	
	
	<br><br>
	
	<c:set var="str2" value="abcde"></c:set>
	长度： ${fn:length(str2)} <br>
	是否已字符de结尾: ${fn:endsWith(str2,"de")}<br>
</body>
</html>